Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(amazonq): enable SQL conversions feature #5925

Open
wants to merge 12 commits into
base: master
Choose a base branch
from

Conversation

dhasani23
Copy link
Contributor

@dhasani23 dhasani23 commented Nov 5, 2024

Problem

Enable the SQL conversion feature for /transform.

Solution

Enable feature, intended for 11/21 release.


License: I confirm that my contribution is made under the terms of the Apache 2.0 license.

@dhasani23 dhasani23 requested a review from a team as a code owner November 5, 2024 01:12
@dhasani23 dhasani23 marked this pull request as draft November 5, 2024 01:12
Copy link

github-actions bot commented Nov 5, 2024

  • This pull request modifies code in src/* but no tests were added/updated.
    • Confirm whether tests should be added or ensure the PR description explains why tests are not required.

@dhasani23 dhasani23 changed the title zip manifest fix feat(amazonq): enable DMS feature Nov 5, 2024
Copy link

github-actions bot commented Nov 5, 2024

  • This pull request modifies code in src/* but no tests were added/updated.
    • Confirm whether tests should be added or ensure the PR description explains why tests are not required.
  • This pull request implements a feat or fix, so it must include a changelog entry (unless the fix is for an unreleased feature). Review the changelog guidelines.
    • Note: beta or "experiment" features that have active users should announce fixes in the changelog.
    • If this is not a feature or fix, use an appropriate type from the title guidelines. For example, telemetry-only changes should use the telemetry type.

@dhasani23 dhasani23 changed the title feat(amazonq): enable DMS feature feat(amazonq): enable SQL conversions feature Nov 5, 2024
@dhasani23
Copy link
Contributor Author

TODO: add changelog entry

@dhasani23 dhasani23 force-pushed the dmsUpdates branch 5 times, most recently from c5a5a14 to 112bd34 Compare November 13, 2024 21:38
@dhasani23 dhasani23 marked this pull request as ready for review November 13, 2024 21:46
@dhasani23 dhasani23 requested review from a team as code owners November 13, 2024 21:46
@@ -80,6 +81,7 @@ import { setContext } from '../../shared/vscode/setContext'
import { makeTemporaryToolkitFolder } from '../../shared'
import globals from '../../shared/extensionGlobals'
import { convertDateToTimestamp } from '../../shared/datetime'
import { spawnSync } from 'child_process'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

use our ChildProcess wrapper unless there is a technical reason why it can't be used.

It has logging, and will eventually gain some performance-tracking and telemetry features.

// as long as at least one of these strings is found, project contains embedded SQL statements
const searchStrings = ['oracle.jdbc.OracleDriver', 'jdbc:oracle:thin:@//', 'jdbc:oracle:oci:@//']
for (const str of searchStrings) {
const command = process.platform === 'win32' ? 'findstr' : 'grep'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

there is a isWin util function

@@ -624,6 +639,14 @@ export class GumbyController {

case ConversationState.WAITING_FOR_TRANSFORMATION_OBJECTIVE: {
const objective = data.message.trim().toLowerCase()
// since we're prompting the user, their project(s) must be eligible for both types of transformations, so track how often this happens here
if (objective === 'language upgrade' || objective === 'sql conversion') {
telemetry.codeTransform_submitSelection.emit({
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Best practice to use a run block, but I don't have anything to do here, just want to emit a metric to track how often the user gets to this point because it's meaningful for us. Furthermore, handleLanguageUpgrade and handleSQLConversion below already emit a validateProject metric.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants